package com.bwda.dsrs.filecenter.quartz;

import com.bwda.dsrs.filecenter.service.ResAuditTaskExecutionService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;


/**
 * Description: 定时执行任务
 *
 * @author ligai
 * @date 2020年9月1日10:07:51
 */
@Component
public class TaskServiceExecutionPolicy extends AbstractBaseTask {

    private static Logger logger = LoggerFactory.getLogger(TaskServiceExecutionPolicy.class);


    /**
     * Description: 清理定时任务执行历史记录的任务
     *
     * @return boolean
     * @throws TaskServiceException
     */
    @Override
    public boolean executeTask() throws TaskServiceException {
        logger.info("定期执行了任务");
        //执行任务的类和方法
        ResAuditTaskExecutionService resAuditTaskExecutionService = SpringUtil.getBean(ResAuditTaskExecutionService.class);

        resAuditTaskExecutionService.timerExecute();

        return true;
    }
}
